/**
 @file ctc_eunit.h

 @author  Copyright (C) 2011 Centec Networks Inc.  All rights reserved.

 @date 2023-11-14

 @version v6.0

   This file contains all eunit related data structure, enum, macro and proto.
*/

#ifndef _CTC_EUNIT_H
#define _CTC_EUNIT_H
#ifdef __cplusplus
extern "C" {
#endif

/****************************************************************
 *
 * Header Files
 *
 ***************************************************************/

#include "ctc_mix.h"
#include "ctc_const.h"

/****************************************************************
*
* Defines and Macros
*
****************************************************************/

#define CTC_EUNIT_APP_NUM 32

struct ctc_eunit_debug_s
{
    uint8 app_id;      /**<[AT] Identify user application, start at CTC_EUNIT_APP_ID_CUSTOM_BASE */
    uint8 level;       /**<[AT] 0, disable debug out, 1 enable error-level, 2 enable error-level and info-level, default is 1 */
};
typedef struct ctc_eunit_debug_s ctc_eunit_debug_t;

enum ctc_eunit_cfg_type_s
{
    CTC_EUNIT_CFG_TYPE_DEBUG,            /**<[AT] Config eunit app debug out, refer to ctc_eunit_debug_t */

    CTC_EUNIT_CFG_TYPE_CUSTOM_BASE = 64, /**<[AT] The base of config type for customer */
    CTC_EUNIT_CFG_TYPE_MAX = 255
};
typedef enum ctc_eunit_cfg_type_s ctc_eunit_cfg_type_t;


/****************************************************************
*
* Data Structures
*
****************************************************************/

/**
 @defgroup eunit EUNIT
 @{
*/

struct ctc_eunit_install_s
{
    char*   bin_file;       /**<[TMM.AT] eunit image file name */
    uint32* bin_data;       /**<[TMM.AT] eunit image arrary */
    uint32  bin_size;       /**<[TMM.AT] eunit image array size*/
};
typedef struct ctc_eunit_install_s ctc_eunit_install_t;

struct ctc_eunit_cfg_s
{
    uint8  eunit_id;     /**<[AT] [in] Eunit id */
    uint8  type;         /**<[AT] [in] Config type, refer to ctc_eunit_cfg_type_t */

    uint16 data_len;     /**<[AT] [in] Config data length */ 
    void*  p_data;       /**<[AT] [in][out] Config data ptr */
};
typedef struct ctc_eunit_cfg_s ctc_eunit_cfg_t;

struct ctc_eunit_status_s
{
    uint8  eunit_id;     /**<[AT] [in] Config eunit id */
    uint8  app_id;       /**<[AT] [in] Identify user application, start at CTC_EUNIT_APP_ID_CUSTOM_BASE  */
    uint8 alive_cnt;     /**<[AT] [out] Application alive count */
};
typedef struct ctc_eunit_status_s ctc_eunit_status_t;

/**@} end of @defgroup eunit  */

#ifdef __cplusplus
}
#endif

#endif


